package com.educatioin.manage.constant;

/**
 * Created by Zhangyin on 2018/4/7.
 * 订单状态
 */
public enum OrderStatus {

    UN_PAYED(-1,"未付款"),
    PAYED(0,"已付款"),
    ORDERED(1,"已报名"),
    GOODS_SENT(2,"已发货"),
    CLOSED(3,"已关闭"),
    COMPLETE(4,"已完成");

    private int type;
    private String description;

    private OrderStatus(int type, String description){
        this.type = type;
        this.description = description;
    }

    public static OrderStatus valueOf(int value) { //从int到enum的转换函数
        for (OrderStatus st : OrderStatus.values()) {
            if (st.getType() == value) {
                return st;
            }
        }
        return null;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}

